﻿--
-- Dropping stored procedure pr_LoaiHang_SelectAll : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_LoaiHang_SelectAll]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_LoaiHang_SelectAll]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_LoaiHang_SelectAll
-- Author:	MinhNN
-- Create date:	5/14/2012 10:00:31 PM
-- Description:	This stored procedure is intended for selecting all rows from LoaiHang table
-- ==========================================================================================
Create Procedure pr_LoaiHang_SelectAll
As
Begin
	Select 
		[MaLH],
		[TenLH]
	From LoaiHang
End

GO


--
-- Dropping stored procedure pr_LoaiHang_SelectRow : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_LoaiHang_SelectRow]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_LoaiHang_SelectRow]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_LoaiHang_SelectRow
-- Author:	MinhNN
-- Create date:	5/14/2012 10:00:31 PM
-- Description:	This stored procedure is intended for selecting a specific row from LoaiHang table
-- ==========================================================================================
Create Procedure pr_LoaiHang_SelectRow
	@MaLH varchar(10)
As
Begin
	Select 
		[MaLH],
		[TenLH]
	From LoaiHang
	Where
		[MaLH] = @MaLH
End

GO


--
-- Dropping stored procedure pr_LoaiHang_Insert : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_LoaiHang_Insert]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_LoaiHang_Insert]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_LoaiHang_Insert
-- Author:	MinhNN
-- Create date:	5/14/2012 10:00:31 PM
-- Description:	This stored procedure is intended for inserting values to LoaiHang table
-- ==========================================================================================
Create Procedure pr_LoaiHang_Insert
	@MaLH varchar(10),
	@TenLH nvarchar(50)
As
Begin
	Insert Into LoaiHang
		([MaLH],[TenLH])
	Values
		(@MaLH,@TenLH)

End

GO


--
-- Dropping stored procedure pr_LoaiHang_Update : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_LoaiHang_Update]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_LoaiHang_Update]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_LoaiHang_Update
-- Author:	MinhNN
-- Create date:	5/14/2012 10:00:31 PM
-- Description:	This stored procedure is intended for updating LoaiHang table
-- ==========================================================================================
Create Procedure pr_LoaiHang_Update
	@MaLH varchar(10),
	@TenLH nvarchar(50)
As
Begin
	Update LoaiHang
	Set
		[TenLH] = @TenLH
	Where		
		[MaLH] = @MaLH

End

GO


--
-- Dropping stored procedure pr_LoaiHang_DeleteRow : 
--

IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[pr_LoaiHang_DeleteRow]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
  DROP PROCEDURE [dbo].[pr_LoaiHang_DeleteRow]
  
GO

-- ==========================================================================================
-- Entity Name:	pr_LoaiHang_DeleteRow
-- Author:	MinhNN
-- Create date:	5/14/2012 10:00:31 PM
-- Description:	This stored procedure is intended for deleting a specific row from LoaiHang table
-- ==========================================================================================
Create Procedure pr_LoaiHang_DeleteRow
	@MaLH varchar(10)
As
Begin
	Delete LoaiHang
	Where
		[MaLH] = @MaLH

End

GO
